﻿using System;
using Csla.Serialization;
using Csla;

namespace Validation
{
    [Serializable()]
    public class CheckExistServiceCriteria : CriteriaBase<CheckExistServiceCriteria>
    {
        public CheckExistServiceCriteria() { }

        public CheckExistServiceCriteria(string tableName, string fieldName, string fieldType, string fieldValue)
        {
            this.TableName = tableName.ToLower();
            this.FieldName = fieldName.ToLower();
            this.FieldType = fieldType.ToLower();
            this.FieldValue = fieldValue.ToLower();
        }

        private static PropertyInfo<string> TableNameProperty = RegisterProperty<string>(p => p.TableName, "TableName");
        public string TableName
        {
            get { return ReadProperty(TableNameProperty); }
            set { LoadProperty(TableNameProperty, value); }
        }

        private static PropertyInfo<string> FieldNameProperty = RegisterProperty<string>(p => p.FieldName, "FieldName");
        public string FieldName
        {
            get { return ReadProperty(FieldNameProperty); }
            set { LoadProperty(FieldNameProperty, value); }
        }

        private static PropertyInfo<string> FieldTypeProperty = RegisterProperty<string>(p => p.FieldType, "FieldType");
        public string FieldType
        {
            get { return ReadProperty(FieldTypeProperty); }
            set { LoadProperty(FieldTypeProperty, value); }
        }

        private static PropertyInfo<string> FieldValueProperty = RegisterProperty<string>(p => p.FieldValue, "FieldValue");
        public string FieldValue
        {
            get { return ReadProperty(FieldValueProperty); }
            set { LoadProperty(FieldValueProperty, value); }
        }
												
    }
}
